# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=logc-libs
pkgver=0.1.0
pkgrel=0
pkgdesc="A set of libraries adding LogC support to third-party libraries"
url="https://gitlab.nic.cz/turris/logc-libs"
# s390x: blocked by czmq
arch="all !s390x"
license="MIT"
makedepends="
	autoconf-archive
	automake
	czmq-dev
	libevent-dev
	libtool
	logc-dev
	"
subpackages="
	$pkgname-dev
	logc-czmq:_lib
	logc-libevent:_lib
	"
source="https://gitlab.nic.cz/turris/logc-libs/-/archive/v$pkgver/logc-libs-v$pkgver.tar.bz2"
builddir="$srcdir/$pkgname-v$pkgver"
options="!check"  # tests are not supported on musl

prepare() {
	default_prepare
	./bootstrap
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--with-czmq \
		--with-event
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

_lib() {
	pkgdesc="LogC extension for ${subpkgname#logc-}"

	amove usr/lib/*${subpkgname#logc-}_logc.so*
}

sha512sums="
21b14bcaf516b63215a3860816f25c65477e8954a807596ab1e3dbb48ad86a051abec0f03ee0fcc8351e7485f8568d6efbb1d9ef69e0301f7cbef6374d7cefe9  logc-libs-v0.1.0.tar.bz2
"
